const http = require("http");

const  server = http.createServer();

//监听时间

server.on("request",(req,res)=>{
    res.setHeader("content-type","text/html;charset=utf-8");
    if(req.url == "/" && req.method == "GET")
    {
        res.write("这是首页");
    }
    else if(req.url== "/student" && req.method == "GET")
    {
        res.write("这是学生页面");
    }
})
server.listen("3000",()=>{
    console.log("3000端口");
})